#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int n=0;
cin>>n;
vector<long long> array;
int b=0;
long long x=0;
while(b<3*n){
cin>>x;
array.push_back(x);
b++;
}
sort(array.begin(),array.end());
long long sum=0;
b=0;
while(b<n){
b++;
sum+=array[3*n-2*b];
}
cout<<sum;
return 0;
}

